#pragma once

#include <map>
#include <vector>
#include <string>
#include "Enum.h"
#include "Constants.h"

class TextureManager {
protected:
	std::vector<unsigned int> m_textures;
	std::map<DungeonType, std::map<int, std::vector<unsigned int>>> m_tileTextures;
	std::map<DungeonType, std::vector<unsigned int>> m_wallTextures;
	std::map<TypeHierarchy, std::map<int, std::vector<unsigned int>>> m_objectTextures;
	unsigned int loadTexture(std::string filename);
	void addTileTexture(DungeonType dungeonType, TileType tileType, std::string filename);
	void addWallTexture(DungeonType dungeonType, std::string filename);
	void addObjectTexture(TypeHierarchy category, int type, std::string filename);
	static int convertIndex(unsigned int size, int x, int y);
public:
	TextureManager();
	~TextureManager();
	unsigned int getTileTexture(DungeonType dungeonType, TileType tileType, int x, int y) const;
	unsigned int getObjectTexture(TypeHierarchy category, int type, int index = 0) const;
	unsigned int getWallTexture(DungeonType dungeonType, int x, int y) const;
	unsigned int getTexture(int i) const;
};